public class Student {
    public String name;
    private int age;
    public String sex;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    //构造方法   --  名称必须与类名形同
    public Student(){
        this("lisa",12,"女");
        //this()必须放在第一行  表示调用本类中其他的构造方法  （重载）
        System.out.println("222");
    }
    public Student(String name, int age, String sex){
        this.name = name;
        this.age = age;
        this.sex = sex;
    }
    public void print(){
        System.out.println(this.name+" "+this.age+" "+this.sex);
    }
    /*
    public void setStudent(String name, int age, String sex){
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.print();
    }*/

    public static void main(String[] args) {
        Student lisa = new Student();
        lisa.print();
//        lisa.setStudent("lisa",12,"女");
    }
}
